package zhieasy.cn.xpu_helper.controller.course;

/**
 * @author DaHang
 * @date 2020/8/21 23:04
 */

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import zhieasy.cn.common.utils.result.ResultUtils;
import zhieasy.cn.common.vo.ResultVO;
import zhieasy.cn.model.course.ScheduleInfo;
import zhieasy.cn.service.course.ScheduleService;

/**
 * 日程操作
 */
@Api(tags = "课程模块，对日程操作接口" , value = "/course/schedule")
@Slf4j
@RequestMapping("/course/schedule")
@RestController
public class ScheduleController {
    @Autowired
    ScheduleService scheduleService;

    @ApiOperation(value = "/addSchedule",notes = "手动添加日程")
    @RequestMapping(value = "/addSchedule" , method = RequestMethod.POST)
    public ResultVO addSchedule(@RequestBody ScheduleInfo scheduleInfo){
        int scheduleId = scheduleService.insertNewSchedule(scheduleInfo);
        return ResultUtils.success("插入成功",scheduleId);
    }

    @ApiOperation(value = "/deleteSchedule" , notes = "通过id删除日程")
    @RequestMapping(value = "/deleteSchedule", method = RequestMethod.POST)
    public ResultVO deleteSchedule(String scheduleId){

        return ResultUtils.success();
    }

    @ApiOperation(value = "/cleatSchedule", notes = "清空日程")
    @RequestMapping(value = "/cleatSchedule", method = RequestMethod.POST)
    public ResultVO clearSchedule(){

        return ResultUtils.success();
    }

    @ApiOperation(value = "/chooseWeekSchedule" , notes = "选择第几周的日程")
    @RequestMapping(value = "/chooseWeekSchedule", method = RequestMethod.GET)
    public ResultVO chooseWeekSchedule(int week){

        return ResultUtils.success();
    }


}
